package com.ssrs.aliyunoss.config;

import cn.hutool.core.util.StrUtil;
import com.ssrs.aliyunoss.AliyunOssPlugin;
import com.ssrs.framework.Config;
import com.ssrs.framework.extend.annotation.ExtendItem;
import com.ssrs.platform.FixedConfigItem;
import com.ssrs.platform.code.ControlType;
import com.ssrs.platform.code.DataType;
import com.ssrs.platform.extend.ConfigService;

/**
 * @author ssrs
 */
@ExtendItem(
        plugin = AliyunOssPlugin.class,
        extendService = ConfigService.class,
        description = "阿里云OSS AccessKeySecret"
)
public class OssAccessKeySecret extends FixedConfigItem {

    public static final String ID = "com.ssrs.aliyunoss.config.OssAccessKeySecret";

    public OssAccessKeySecret() {
        super(ID, DataType.SHORTTEXT, ControlType.TEXT, "AccessKeySecret");
    }

    public static String getValue() {
        String v = Config.getValue(ID);
        if (StrUtil.isEmpty(v)) {
            return "";
        }
        return v;
    }
}
